
cmake_minimum_required(VERSION 3.22.1)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")



include_directories(include  JavaCallHelper.h ffmpeg
render net gl util audioPlayer)
#target_compile_options(${libname} PUBLIC -fsanitize=address -fno-omit-frame-pointer)
#set_target_properties(${libname} PROPERTIES LINK_FLAGS -fsanitize=address)
#MNQueue.h

project("audiocamera")
message(" test ${CMAKE_SOURCE_DIR}")
message(" test ${CMAKE_ANDROID_ARCH_ABI}")
set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/libs/${CMAKE_ANDROID_ARCH_ABI}")
message(" test ${CMAKE_CXX_FLAGS}")

file(GLOB src-files
        ${CMAKE_SOURCE_DIR}/util/*.cpp
        ${CMAKE_SOURCE_DIR}/ffmpeg/*.cpp
        ${CMAKE_SOURCE_DIR}/gl/*.cpp
        ${CMAKE_SOURCE_DIR}/render/*.cpp
        ${CMAKE_SOURCE_DIR}/audioPlayer/*.cpp
        ${CMAKE_SOURCE_DIR}/net/*.cpp)
link_directories(${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI})
add_library(${CMAKE_PROJECT_NAME} SHARED
        JavaCallHelper.cpp
        ${src-files}
        native-lib.cpp)

target_link_libraries(${CMAKE_PROJECT_NAME}
        # List libraries link to the target library
        android
        avcodec
        avfilter
        avformat
        avutil
        swresample
        swscale
        EGL
        GLESv3
        OpenSLES
        log)